﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage.Master" CodeBehind="List.aspx.vb" Inherits="RUHResturants.List" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        List of Resturants:
        <br />
    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
    AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
        <Columns>
            <asp:BoundField DataField="RestName" HeaderText="RestName" 
                SortExpression="RestName" />
            <asp:BoundField DataField="Telephon" HeaderText="Telephon" 
                SortExpression="Telephon" />
            <asp:BoundField DataField="PriceLevel" HeaderText="PriceLevel" 
                SortExpression="PriceLevel" />
            <asp:BoundField DataField="WorkingHours" HeaderText="WorkingHours" 
                SortExpression="WorkingHours" />
            <asp:TemplateField HeaderText="ImgName" SortExpression="ImgName">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ImgName") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("ImgName", "RestImages/{0}") %>' Height="80" Width="70" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("Id", "Details.aspx?Id={0}") %>' 
                        Text="Details"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\RUHRestaurantsDB.accdb" 
    ProviderName="System.Data.OleDb" 
    SelectCommand="SELECT * FROM [ResturantsDetails]"></asp:SqlDataSource>
</asp:Content>
